package com.qlzb.taskmanagement.utils;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * Created with IntelliJ IDEA.
 *
 * @ClassName ConstantConfiguration
 * @Description TODO    配置文件配置项
 * @Authr 袁聪
 * @Date 2018/6/29 17:55
 * @Version v2.0
 */
@Component
public class ConstantConfiguration implements InitializingBean {

/*    *//* 阿里云文件上传 *//*
    @Value("${aliyunoss.file.endpoint}")
    private String endpoint;

    @Value("${aliyunoss.file.keyid}")
    private String accessKeyId;

    @Value("${aliyunoss.file.keysecret}")
    private String accessKeySecret;

    @Value("${aliyunoss.file.bucketname}")
    private String bucketName;

    @Value("${aliyunoss.file.filehost}")
    private String fileHost;

    @Value("${aliyunoss.file.protocol}")
    private String protocol;


    public static String ALIYUNOSS_END_POINT;
    public static String ALIYUNOSS_ACCESS_KEY_ID;
    public static String ALIYUNOSS_ACCESS_KEY_SECRET;
    public static String ALIYUNOSS_BUCKET_NAME;
    public static String ALIYUNOSS_FILE_HOST;
    public static String ALIYUNOSS_FILE_PROTOCOL;*/

    /* 分页 */
    @Value("${default.page-num}")
    private int pageNum;

    @Value("${default.page-size}")
    private int pageSize;


    public static int PAGE_NUM;
    public static int PAGE_SIZE;



    @Override
    public void afterPropertiesSet() throws Exception {

/*        *//* 阿里云文件上传 *//*
        ALIYUNOSS_END_POINT = endpoint;
        ALIYUNOSS_ACCESS_KEY_ID = accessKeyId;
        ALIYUNOSS_ACCESS_KEY_SECRET = accessKeySecret;
        ALIYUNOSS_BUCKET_NAME = bucketName;
        ALIYUNOSS_FILE_HOST = fileHost;
        ALIYUNOSS_FILE_PROTOCOL = protocol;*/

        /* 分页 */
        PAGE_NUM = pageNum;
        PAGE_SIZE = pageSize;


    }
}
